function checkWowDomain(){
    var hf = top.location.href;
    if(hf.indexOf('wow.uuola.com')>=0){
        ut.reload('http://wow.uuola.com/site/home.html?www-reload');
    }
};
checkWowDomain();
var UUOLA = UUOLA ||{};
UUOLA.SUG={
    BAIDU:{
        el:null,
        data:[],
        url:'http://unionsug.baidu.com/su?p=3&wd=',
        give:function(json){
            UUOLA.SUG.BAIDU.data = json.s;
            UUOLA.SUG.BAIDU.el.setOptions({data: UUOLA.SUG.BAIDU.data}).prev().flushCache().result();
        },
        bind:function(e){
            UUOLA.SUG.BAIDU.el=jQuery('#'+e);
            UUOLA.SUG.BAIDU.el.autocomplete(UUOLA.SUG.BAIDU.data,{
                minChars:0,
                max: 20,
                width: 640,
                cacheLength:0
            });
            UUOLA.SUG.BAIDU.el.keydown(function(e){
                var key = e.which;
                if(key == 38 || key == 40 || key==9 || key==33 || key==34){
                    return;
                }
                UUOLA.SUG.BAIDU.req();
            });
        },
        req:function(){
            var v = ut.enc(UUOLA.SUG.BAIDU.el.val());
            if(va.isnull(v)){
                return;
            }
            $.ajax({
                cache:false,
                async:false,
                url:UUOLA.SUG.BAIDU.url+v,
                dataType:"jsonp",
                jsonp:"cb",
                jsonpCallback:"UUOLA.SUG.BAIDU.give"
            });
        }
    },
    TAOBAO:{
        el:null,
        data:[],
        url:'http://suggest.taobao.com/sug?extras=1&code=utf-8&q=',
        give:function(json){
            UUOLA.SUG.TAOBAO.data = json.result;
            UUOLA.SUG.TAOBAO.el.setOptions({data: UUOLA.SUG.TAOBAO.data}).prev().flushCache().result();
        },
        bind:function(e){
            UUOLA.SUG.TAOBAO.el=jQuery('#'+e);
            UUOLA.SUG.TAOBAO.el.autocomplete(UUOLA.SUG.BAIDU.data,{
                minChars: 1,
                max: 50,
                width: 640,
                formatItem: function(row, i, max) {
                    return row[0];
                }
            });
            UUOLA.SUG.TAOBAO.el.keydown(function(e){
                var key = e.which;
                if(key == 38 || key == 40 || key==9 || key==33 || key==34){
                    return;
                }
                UUOLA.SUG.TAOBAO.req();
            });
        },
        req:function(){
            var v = ut.enc(UUOLA.SUG.TAOBAO.el.val());
            if(va.isnull(v)){
                return;
            }
            $.ajax({
                cache:false,
                url:UUOLA.SUG.TAOBAO.url+v,
                dataType:"jsonp",
                jsonp:"callback",
                jsonpCallback:"UUOLA.SUG.TAOBAO.give"
            });
        }
    }
};

function doWebSearch(){
    var kw = $('#kw').val();
    if(va.isnull(kw)){
        kw='';
    }
    var enc_kw = kw;
    var sel = ut.getselv('selsite');
    if(va.isnull(sel)){
        sel = 'baidu';
    }
    $('#J_q').val(enc_kw);
    $('#J_sel').val(sel);
    $('#sofrm').attr('action',def.ctx+'/index/web_so.shtm').submit();
};

function doNewsSearch(){
    var kw = $('#kw').val();
    if(va.isnull(kw)){
        kw='';
    }
    var enc_kw = kw;
    var sel = ut.getselv('selsite');
    if(va.isnull(sel)){
        sel = 'baidu';
    }
    $('#J_q').val(enc_kw);
    $('#J_sel').val(sel);
    $('#sofrm').attr('action',def.ctx+'/index/news_so.shtm').submit();
};

function doMp3Search(){
    var kw = $('#kw').val();
    if(va.isnull(kw)){
        kw='';
    }
    var enc_kw = kw;
    var sel = ut.getselv('selsite');
    if(va.isnull(sel)){
        sel = 'baidu';
    }
    $('#J_q').val(enc_kw);
    $('#J_sel').val(sel);
    $('#sofrm').attr('action',def.ctx+'/index/mp3_so.shtm').submit();
};

function doVodSearch(){
    var kw = $('#kw').val();
    if(va.isnull(kw)){
        kw='';
    }
    var enc_kw = kw;
    var sel = ut.getselv('selsite');
    if(va.isnull(sel)){
        sel = 'baidu';
    }
    $('#J_q').val(enc_kw);
    $('#J_sel').val(sel);
    $('#sofrm').attr('action',def.ctx+'/index/vod_so.shtm').submit();
};

function doPicSearch(){
    var kw = $('#kw').val();
    if(va.isnull(kw)){
        kw='';
    }
    var enc_kw = kw;
    var sel = ut.getselv('selsite');
    if(va.isnull(sel)){
        sel = 'baidu';
    }
    $('#J_q').val(enc_kw);
    $('#J_sel').val(sel);
    $('#sofrm').attr('action',def.ctx+'/index/pic_so.shtm').submit();
};

function doAskSearch(){
    var kw = $('#kw').val();
    if(va.isnull(kw)){
        kw='';
    }
    var enc_kw = kw;
    var sel = ut.getselv('selsite');
    if(va.isnull(sel)){
        sel = 'baidu';
    }
    $('#J_q').val(enc_kw);
    $('#J_sel').val(sel);
    $('#sofrm').attr('action',def.ctx+'/index/ask_so.shtm').submit();
};

function doTieSearch(){
    var kw = $('#kw').val();
    if(va.isnull(kw)){
        alert('请输入帖吧名称.');
        return;
    }
    var enc_kw = kw;
    var sel = ut.getselv('selsite');
    if(va.isnull(sel)){
        sel = 'baidu';
    }
    $('#J_q').val(enc_kw);
    $('#J_sel').val(sel);
    $('#sofrm').attr('action',def.ctx+'/index/tie_so.shtm').submit();
};

function doWenkuSearch(){
    var kw = $('#kw').val();
    if(va.isnull(kw)){
        kw='';
    }
    var enc_kw = kw;
    var sel = ut.getselv('selsite');
    if(va.isnull(sel)){
        sel = 'baidu';
    }
    $('#J_q').val(enc_kw);
    $('#J_sel').val(sel);
    $('#sofrm').attr('action',def.ctx+'/index/wenku_so.shtm').submit();
};

function doMapSearch(){
    var kw = $('#kw').val();
    if(va.isnull(kw)){
        alert('请输入地理名称.');
        return;
    }
    var enc_kw = kw;
    var sel = ut.getselv('selsite');
    if(va.isnull(sel)){
        sel = 'baidu';
    }
    $('#J_q').val(enc_kw);
    $('#J_sel').val(sel);
    $('#sofrm').attr('action',def.ctx+'/index/map_so.shtm').submit();
};

function doBuySearch(){
    var kw = $('#kw').val();
    if(va.isnull(kw)){
        return;
    }
    var enc_kw = kw;
    var sel = ut.getselv('selsite');
    if(va.isnull(sel)){
        sel = 'taobao';
    }
    $('#J_q').val(enc_kw);
    $('#J_sel').val(sel);
    $('#sofrm').attr('action',def.ctx+'/index/buy_so.shtm').submit();
};

function doBaikeSearch(){
    var kw = $('#kw').val();
    if(va.isnull(kw)){
        kw='互联网';
    }
    var enc_kw = kw;
    var sel = ut.getselv('selsite');
    if(va.isnull(sel)){
        sel = 'baidu';
    }
    $('#J_q').val(enc_kw);
    $('#J_sel').val(sel);
    $('#sofrm').attr('action',def.ctx+'/index/baike_so.shtm').submit();
};

function doFanyiSearch(){
    var kw = $('#kw').val();
    if(va.isnull(kw)){
        kw='互联网';
    }
    var enc_kw = kw;
    var sel = ut.getselv('selsite');
    if(va.isnull(sel)){
        sel = 'baidu';
    }
    $('#J_q').val(enc_kw);
    $('#J_sel').val(sel);
    $('#sofrm').attr('action',def.ctx+'/index/fanyi_so.shtm').submit();
};

function doJobSearch(){
    var kw = $('#kw').val();
    if(va.isnull(kw)){
        return;
    }
    var enc_kw = kw;
    var sel = ut.getselv('selsite');
    if(va.isnull(sel)){
        sel = 'qiancheng';
    }
    $('#J_q').val(enc_kw);
    $('#J_sel').val(sel);
    $('#sofrm').attr('action',def.ctx+'/index/job_so.shtm').submit();
};

function  ShowDate(){
    var t = g_sys_time || new Date().getTime();
    var now = new Date(t);
    $('#currDate').text((now).Pattern("yyyy年MM月dd日"));
    $('#week').text((now).Pattern(" 周E"));
    var jqTime = $('#time');
    window.setInterval(function(){
        jqTime.text(CurentTime());
    },1000);
    $('#nongli').text(CnDateofDateStr(now));
    $('#jieqi').html(SolarTerm(now));
};
function gotoSite(s){
    if(!va.isnull(s)){
        window.open(s);
    }
};
function reloadWord(){
    var w = ut.get('word');
    if(va.isnull(w)){
        return;
    }
    $('#kw').val(filter.html(ut.dec(w)));
};
function todayOfPast(){
    var t = g_sys_time || new Date().getTime();
    var now = new Date(t);
    var today = ut.enc((now).Pattern("M月d日"));
    window.open(def.ctx+'/index/baike_so.shtm?sel=baidu-wiki&q='+today);
};
function todayHotNews(){
    var jqHotNews = $('#hotnews');
    var t='<a href="javascript:;" onclick="openHotWord(\'@id\',\'@url\');">· @word</a>';
    $.get(def.ctx+'/hotword/query_list.shtm','cid=43&ls=12',function(x){
        var a=[];
        if(x.length>0){
            for(var k in x){
                a.push(t.replace(/@id/,x[k].id).replace(/@url/,x[k].gotourl).replace(/@word/,x[k].word));
            }
            jqHotNews.html(a.join(''));
        }else{
            jqHotNews.html('');
        }
    });
};
function showHotUnion(eid,c,ls){
    var jqHotUnion = $('#'+eid);
    var p={cid:c,ls:ls};
    var t='<a href="@url" target="_blank" id="hotword-@id">@word</a>';
    $.get(def.ctx+'/hotword/query_list.shtm',$.param(p),function(x){
        var a=[];
        if(x.length>0){
            for(var k in x){
                a.push(t.replace(/@id/,x[k].id).replace(/@url/,x[k].gotourl).replace(/@word/,x[k].word));
            }
            jqHotUnion.append(a.join(''));
        }else{
            jqHotUnion.html('');
        }
    });
};
function todayHotUnion(){
    showHotUnion('hotunion',50,10);
};
function todayHotUnion2(){
    showHotUnion('hotunion2',62,10);
};
function todayHotUnion3(){
    showHotUnion('hotunion3',155,3);
};
function todayHotUnion4(){
    showHotUnion('hotunion4',211,32);
};
function openHotWord(id,url){
    window.open(url);
};
jQuery(function(){
    $('a').bind('focus',function(){
        if(this.blur){
            this.blur();
        };
    });
});
window.onerror = function(){return true;};